{% extends 'base.html' %}
{% block content %}
<h2>月度比赛列表</h2>
<a href="{{ url_for('student_reservations.create_monthly_competition') }}" class="btn btn-primary">创建新比赛</a>
<table class="table">
    <thead>
        <tr>
            <th>名称</th>
            <th>描述</th>
            <th>开始日期</th>
            <th>结束日期</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
    {% for comp in competitions %}
        <tr>
            <td>{{ comp.name }}</td>
            <td>{{ comp.description }}</td>
            <td>{{ comp.start_date }}</td>
            <td>{{ comp.end_date }}</td>
            <td>
                <a href="{{ url_for('student_reservations.monthly_competition_detail', comp_id=comp.id) }}" class="btn btn-info">详情</a>
            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>
{% endblock %}
